package com.haoshuang.zhouzhoubang.ui.adapter


import android.graphics.Color
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemSkillCheckBinding
import com.haoshuang.zhouzhoubang.model.bean.SortBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


/**
 * 订单模块中的订单列表适配器
 * */
class SkillAdapter(data: MutableList<SortBean.Data.Data1>) :
    BaseBindingQuickAdapter<SortBean.Data.Data1, ItemSkillCheckBinding>(data) {


    override fun onBindViewHolder(
        holder: BaseBindingHolder,
        position: Int,
        item: SortBean.Data.Data1?
    ) {
        val binding = ItemSkillCheckBinding.bind(holder.itemView)
        binding.apply {
            tvName.text = item?.cate_name
            if (item?.isCheck == 0) {
                tvName.setTextColor(Color.parseColor("#333333"))
                tvName.setBackgroundResource(R.drawable.bg_4)
            } else {
                tvName.setTextColor(Color.parseColor("#00B7F5"))
                tvName.setBackgroundResource(R.drawable.bg_4l)
            }
        }
    }

}